<template>
    <view class="content">
        <view class="">
            <button @click="getText">{{text}}</button>
        </view>
        <view class="" style="margin-top: 20rpx;">
            {{formData.conten}}
        </view>
        <uni-forms ref="form" :value="formData" validateTrigger="bind">
            <uni-forms-item name="type_id" label="题目类型">
                <usp-tinymce ref="matter" :isHtml="isHtml" v-model="formData.conten" :width="860" :height="360" />
            </uni-forms-item>
        </uni-forms>        
    </view>
</template>

<script>
    
    export default {
        data() {
            return {
                text:"切换纯文本",
                isHtml:false,
                formData: {
                    "conten":"这里输入内容",
                }
            }
        },
        onLoad() {
            
        },
        methods: {
            getText(){
                if(this.isHtml){
                    this.isHtml = false
                    this.text = "切换带html"
                }else{
                    this.isHtml = true
                    this.text = "切换纯文本"
                }
                
            }
        }
    }
</script>

<style>
    .content {
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
    }

    .logo {
        height: 200rpx;
        width: 200rpx;
        margin-top: 200rpx;
        margin-left: auto;
        margin-right: auto;
        margin-bottom: 50rpx;
    }

    .text-area {
        display: flex;
        justify-content: center;
    }

    .title {
        font-size: 36rpx;
        color: #8f8f94;
    }
</style>
